package com.forenow.demo.Bank;
import java.util.Scanner;
public class Login {
    public static void islogin(String username, String password){
        int num=2;
        while (true){
            System.out.print("输入账号：");
            Scanner sc=new Scanner(System.in);
            String zh=sc.next();
            System.out.print("输入密码：");
            String pas=sc.next();
            if (zh.equals(username)&&pas.equals(password)){
                System.out.println("登录成功！");
                while (true){
                    System.out.println("1.查询余额  2.存款  3.取款  4.修改密码  5.退出");
                    function.fun();
                }
            }else {
                System.out.println("账号或密码错误！请重新输入！今日还剩"+num+"次");
                if (num==0){
                    System.out.println("密码错误3次，吞卡，请找老司机进行处理！");
                    System.exit(0);
                }
                num--;
            }
        }


    }

}
